package com.foreveross.crawl.vo;

import java.io.Serializable;

/**
 * 任务组信息bean
 * @author luofangyi
 *
 */
public class TaskGroup implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1001894884773483466L;
	
	private Long id;
	private String name;
	/**
	 * 在页面显示时，是否为默认主页
	 */
	private boolean isHome = false;
	
	public TaskGroup(){
		
	}
	
	public TaskGroup(Long id, String name){
		this.id = id;
		this.name = name;
	}
	
	public TaskGroup(Long id, String name, boolean isHome){
		this.id = id;
		this.name = name;
		this.isHome = isHome;
	}
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + (isHome ? 1231 : 1237);
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TaskGroup other = (TaskGroup) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (isHome != other.isHome)
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "TaskGroup [id=" + id + ", name=" + name + ", isHome=" + isHome
				+ "]";
	}

	public boolean getIsHome() {
		return isHome;
	}

	public void setIsHome(boolean isHome) {
		this.isHome = isHome;
	}
}
